package com.blank.task08;

public class CallPackage extends AbstractPackage implements TalkService {

    private int numberOfSMS;    //短信条数
    private int talkTime;   //通话时长
    //无参构造方法
    public CallPackage() {
    }
    //有参构造
    public CallPackage(double monthlyRates,int talkTime,int numberOfSMS) {
        //继承抽象套餐类
        super(monthlyRates);
        setTalkTime(talkTime);
        setNumberOfSMS(numberOfSMS);

    }
    public void setTalkTime(int talkTime){
        this.talkTime = talkTime;
    }
    public int getTalkTime() {
        return talkTime;
    }

    public int getNumberOfSMS() {
        return numberOfSMS;
    }

    public void setNumberOfSMS(int numberOfSMS) {
        this.numberOfSMS = numberOfSMS;
    }



    @Override
    public void showPackageInfo() {
        System.out.println("通话套餐时长为:"+getTalkTime()+"每月资费为:"+getMonthlyRates()+"短信条数:"+getNumberOfSMS());
    }

    @Override
    public void talkShow(int talkTime,PhoneCard phoneCard) {
        System.out.println("通话时长为:"+talkTime+"卡的用户名"+phoneCard.getUserName());
    }
}
